package com.legendshop.openportal.sdk.model.request.v4;

import com.legendshop.openportal.sdk.annotation.EnumValid;
import com.legendshop.openportal.sdk.model.BaseRequest;
import com.legendshop.openportal.sdk.model.constants.AccountTypeEnum;
import com.legendshop.openportal.sdk.model.constants.BusinessCategoryTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

import static com.legendshop.openportal.sdk.model.constants.ApiPathConstantsV4.SHOP_CREATE_SHOP_V4;

/**
 * 创建店铺的表单DTO
 *
 * @author Frank
 */
@Data
public class CreateShopV4Request extends BaseRequest implements Serializable {

    /**
     * 第三方店铺ID
     */
    @NotBlank(message = "第三方店铺ID不能为空")
    private String externalShopId;

    /**
     * 店铺名
     */
    @NotBlank(message = "请填写店铺名")
    private String siteName;

    @ApiModelProperty(value = "租户账号ID", required = true)
    @Length(max = 64, message = "账号ID长度不能超过64位")
    @NotBlank(message = "账号ID不能为空")
    private String accountId;

    @ApiModelProperty(value = "租户账号类型", notes = "ID=租户ID、MOBILE=手机号", required = true)
    @EnumValid(target = AccountTypeEnum.class, message = "账号类型不能为空")
    @NotBlank(message = "账号类型不能为空")
    private String accountType;

    /**
     * 经营品类
     */
    @ApiModelProperty(value = "经营品类")
    @EnumValid(target = BusinessCategoryTypeEnum.class, message = "请填写经营品类")
    private Long businessCategory;


    @Override
    @ApiModelProperty(hidden = true)
    public String getApiPath() {
        return SHOP_CREATE_SHOP_V4;
    }

}
